#include <stdio.h>
#include <stdlib.h>

int main() {
	int n, c = 0;
	char * str, * ptr;
	scanf("%d", &n);
	str = malloc((n + 1) * sizeof(char));
	scanf("%s", str);
	ptr = str + 1;
	while(*ptr != 0 && ptr - str < n) {
		if(*ptr == *(ptr - 1)) {
			c++;
			ptr++;
		}
		ptr++;
		
	}
	printf("%d\n", c);
	return 0;
}
